<h:form xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui" xmlns:t="http://myfaces.apache.org/tomahawk" id="headerForm">

	<h:panelGrid columns="2" width="98%">
		<h:panelGroup>
			<h:panelGrid columns="2" columnClasses="left,right">
				<h:graphicImage url="#{sessionDomainBean == null ? msgs.header_logo_url : sessionDomainBean.logo}" height="50" />
				<h:outputText value="#{msgs.header_logo_title}" styleClass="logoTitle" rendered="#{sessionDomainBean == null}"/>
			</h:panelGrid>
		</h:panelGroup>

		<h:panelGrid width="100%">
			<h:panelGroup style="float:right;padding-right:10px;">
				<h:panelGrid columns="5" columnClasses="rightNoPadding,leftNoPadding">
					<div class="ui-icon ui-icon-image" />
					<h:panelGroup>
						<p:themeSwitcher value="#{headerBean.theme}" style="width:175px;" effect="fade" var="t">
							<f:selectItem itemLabel=" " itemValue="" />
							<f:selectItems value="#{headerBean.themes}" var="theme"
								itemLabel="#{theme.name}" itemValue="#{theme}" />
							<p:ajax listener="#{headerBean.saveTheme}" />

							<p:column>
								<p:graphicImage value="/images/themes/#{t.image}" />
							</p:column>

							<p:column>
                            #{t.name}
                        </p:column>
						</p:themeSwitcher>
					</h:panelGroup>
					<h:outputText value="#{msgs.header_user}: #{sessionUserBean.userName} | " />
					<h:panelGroup>
						<h:outputText value="#{msgs.header_logintime}: " />
						<h:outputText value="#{sessionUserBean.lastLoginTime}">
							<f:convertDateTime pattern="dd/MM/yyyy HH:mm:ss" />
						</h:outputText>
					</h:panelGroup>
				</h:panelGrid>
			</h:panelGroup>
			<h:panelGroup style="float:right;padding-right:10px;">
				<h:panelGrid columns="8" columnClasses="rightNoPadding,leftNoPadding">
					<h:panelGrid id="messageLink" columns="3">
						<div class="#{messagesBean.msgCounter > 0 ? 'ui-icon ui-icon-mail-closed red' : 'ui-icon ui-icon-mail-closed' }" />
						<h:commandLink action="/pages/aplikata/oa/messages.xhtml">
							<h:outputText value=" #{msgs.msg_header} (#{messagesBean.msgCounter})"
								style="#{messagesBean.msgCounter > 0 ? 'color:red;font-weight:bold' : '' }" />
						</h:commandLink>
						<h:outputText value=" | " />
					</h:panelGrid>
					
					<div class="ui-icon ui-icon-person" />
					<p:commandLink action="/pages/aplikata/oa/userReference" ajax="false"
						value="#{msgs.header_user_reference}" />
					
					<div class="ui-icon ui-icon-locked" />
					<h:panelGroup>
						<p:commandLink value="#{msgs.header_modifypassword}" action="/pages/aplikata/common/modifyPassword"
							ajax="false" />
						<h:outputText value=" | " />
					</h:panelGroup>

					<div class="ui-icon ui-icon-power" />
					<p:commandLink value="#{msgs.header_logout}" onclick="logoutDlg.show()" />
				</h:panelGrid>
			</h:panelGroup>
		</h:panelGrid>
	</h:panelGrid>

	<h:panelGrid width="100%">
		<p:menubar model="#{headerBean.navModel}" autoDisplay="false"/>
		<p:breadCrumb model="#{headerBean.breadModel }" />
	</h:panelGrid>
</h:form>
